// BEGIN CUT HERE
/*
PROBLEM STATEMENT
There are several skyscrapers arranged in a row.  You're interested in finding the one from which the maximal number 
of other skyscrapers can be seen.  The i-th skyscraper can be represented as a line segment on a plane with endpoints 
(i, 0) and (i, heights[i]).  A skyscraper can be seen from the roof of another skyscraper if a line segment connecting 
their roofs does not intersect with or touch any other skyscraper.  Return the maximal number of other skyscrapers 
that can be seen from the roof of some skyscraper.

DEFINITION
Class:BestView
Method:numberOfBuildings
Parameters:vector <int>
Returns:int
Method signature:int numberOfBuildings(vector <int> heights)


CONSTRAINTS
-heights will contain between 1 and 50 elements, inclusive. 
-Each element of heights will be between 1 and 1,000,000,000, inclusive.


EXAMPLES

0)
{10}

Returns: 0

There's only a single skyscraper, so you can see no other skyscrapers from its roof.


1)
{5,5,5,5}

Returns: 2

From each skyscraper, you can only see its adjacent neighbors.

2)
{1,2,7,3,2}

Returns: 4

You can see all the other skyscrapers from the central one.

3)
{1,5,3,2,6,3,2,6,4,2,5,7,3,1,5}

Returns: 7

You can see seven skyscrapers from the skyscraper with height 7:


4)
{1000000000,999999999,999999998,999999997,999999996,1,2,3,4,5}

Returns: 6

You can see 6 skyscrapers from the skyscraper with height 999999996 - the nearest one to the left and all 5 
skyscrapers to the right.

5)
{244645169,956664793,752259473,577152868,605440232,569378507,111664772,653430457,454612157,397154317}

Returns: 7



*/
// END CUT HERE
#include <numeric>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
#define Rep(i,n) for(int i=0;i<(n);++i) 
#define For(i,a,b) for(int i=(a);i<=(b);++i) 
#define ForI(TP,i,coll) for(TP (i)=coll.begin();(i)!=coll.end();(i)++)
#define ForD(i,a,b) for(int i=(a);i>=(b);--i)
#define All(a) a.begin(), a.end()

class BestView {
public:
	VI h;

	bool block(int i1, int i2, int i3)
	{
		int h1=h[i1];
		int h2=h[i2];
		int h3=h[i3];

		long long x1=i1-i3, y1=h1-h3;
		long long x2=i2-i1, y2=h2-h1;

		long long cross=x1*y2-x2*y1;

		if(cross==0)
			return true;

		return i1>i3==cross>0;
	}

    int numberOfBuildings(vector <int> heights) {

		h=heights;
		int N=h.size();

        int res=0;
		Rep(i1, N)
		{
			int nres=0;
			Rep(i3, N)
			{
				if(i3==i1)continue;

				int i2=i3;
				int di2=i1>i3?1:-1;
				i2+=di2;
				
				bool bblock=false;
				for(; i2!=i1; i2+=di2)
				{
					if(block(i1,i2,i3))
					{
						bblock=true;
						break;
					}
				}

				if(!bblock)
					nres++;
			}

			res=max(res,nres);
		}

        return res;
    }

};

// BEGIN CUT HERE
#define ARRSIZE(x) (sizeof(x)/sizeof(x[0]))

template<typename T> void print( T a ) {
    cerr << a;
}
static void print( long long a ) {
    cerr << a << "L";
}
static void print( string a ) {
    cerr << '"' << a << '"';
}
template<typename T> void print( vector<T> a ) {
    cerr << "{";
    for ( int i = 0 ; i != a.size() ; i++ ) {
        if ( i != 0 ) cerr << ", ";
        print( a[i] );
    }
    cerr << "}" << endl;
}
template<typename T> void eq( int n, T have, T need ) {
    if ( have == need ) {
        cerr << "Case " << n << " passed." << endl;
    } else {
        cerr << "Case " << n << " failed: expected ";
        print( need );
        cerr << " received ";
        print( have );
        cerr << "." << endl;
    }
}
template<typename T> void eq( int n, vector<T> have, vector<T> need ) {
    if( have.size() != need.size() ) {
        cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements.";
        print( have );
        print( need );
        return;
    }
    for( int i= 0; i < have.size(); i++ ) {
        if( have[i] != need[i] ) {
            cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << ".";
            print( have );
            print( need );
            return;
        }
    }
    cerr << "Case " << n << " passed." << endl;
}
static void eq( int n, string have, string need ) {
    if ( have == need ) {
        cerr << "Case " << n << " passed." << endl;
    } else {
        cerr << "Case " << n << " failed: expected ";
        print( need );
        cerr << " received ";
        print( have );
        cerr << "." << endl;
    }
}
// END CUT HERE


// BEGIN CUT HERE
void main( int argc, char* argv[] ) {
    {
        int heightsARRAY[] = {10};
        vector <int> heights( heightsARRAY, heightsARRAY+ARRSIZE(heightsARRAY) );
        BestView theObject;
        eq(0, theObject.numberOfBuildings(heights),0);
    }
    {
        int heightsARRAY[] = {5,5,5,5};
        vector <int> heights( heightsARRAY, heightsARRAY+ARRSIZE(heightsARRAY) );
        BestView theObject;
        eq(1, theObject.numberOfBuildings(heights),2);
    }
    {
        int heightsARRAY[] = {1,2,7,3,2};
        vector <int> heights( heightsARRAY, heightsARRAY+ARRSIZE(heightsARRAY) );
        BestView theObject;
        eq(2, theObject.numberOfBuildings(heights),4);
    }
    {
        int heightsARRAY[] = {1,5,3,2,6,3,2,6,4,2,5,7,3,1,5};
        vector <int> heights( heightsARRAY, heightsARRAY+ARRSIZE(heightsARRAY) );
        BestView theObject;
        eq(3, theObject.numberOfBuildings(heights),7);
    }
    {
        int heightsARRAY[] = {1000000000,999999999,999999998,999999997,999999996,1,2,3,4,5};
        vector <int> heights( heightsARRAY, heightsARRAY+ARRSIZE(heightsARRAY) );
        BestView theObject;
        eq(4, theObject.numberOfBuildings(heights),6);
    }
    {
        int heightsARRAY[] = {244645169,956664793,752259473,577152868,605440232,569378507,111664772,653430457,454612157,397154317};
        vector <int> heights( heightsARRAY, heightsARRAY+ARRSIZE(heightsARRAY) );
        BestView theObject;
        eq(5, theObject.numberOfBuildings(heights),7);
    }
}
// END CUT HERE

